package com.hqyj.javaGraduation.hotel.controller;

import com.hqyj.javaGraduation.hotel.account.pojo.AccountUser;
import com.hqyj.javaGraduation.hotel.service.HotelMemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

@RestController
@RequestMapping("/hotel")
public class HotelMemberController {

    @Autowired
    private HotelMemberService hotelMemberService;

    /**
     * 127.0.0.1:8080/hotel/members ----get
     * {"page":1,"row":2}
     * @param user
     * @return
     */
    @GetMapping(value = "/members")
    public HashMap<String, Object> getMemberList(AccountUser user) {
        return hotelMemberService.memberList(user);
    }

    /**
     * 普通会员
     * 127.0.0.1:8080/hotel/commonMembers ----get
     *  {"page":1,"row":2}
     * @param user
     * @return
     */
    @GetMapping(value = "/commonMembers")
    public HashMap<String, Object> getCommonMemberList(AccountUser user) {
        return hotelMemberService.getCommonMemberList(user);
    }

    /**
     * 黄金会员
     * 127.0.0.1:8080/hotel/goldMembers ----get
     * {"page":1,"row":2}
     * @param user
     * @return
     */
    @GetMapping(value = "/goldMembers")
    public HashMap<String, Object> getGoldMemberList(AccountUser user) {
        return hotelMemberService.getGoldMemberList(user);
    }

    /**
     * 砖石会员
     * 127.0.0.1:8080/hotel/masonryMembers ----get
     * {"page":1,"row":2}
     * @param user
     * @return
     */
    @GetMapping(value = "/masonryMembers")
    public HashMap<String, Object> getMasonryMemberList(AccountUser user) {
        return hotelMemberService.getMasonryMemberList(user);
    }

}
